package com.djx.comm.enums;


import com.djx.comm.util.ResourcesUtil;

public enum ResultEnum {

	/** 处理成功 */
	SUCCESS("MS000A000", "PROCESS_SUCCESS"),
	/** 服务器异常 */
	REDIS_EXCEPTION("E101001", "REDIS_EXCEPTION"),
	/** 参数错误 */
	RESQUEST_PARAM_ERROR("E101002", "RESQUEST_PARAM_ERROR"),
	/** 权限不足 */
	PERMISSION_NOACCESS("E101004", "PERMISSION_NOACCESS"),
	/** 登录超时,请登录后访问 */
	SESSION_TIMEOUT("E101005", "SESSION_TIMEOUT"),


	/** 服务器繁忙，请稍后重试 */
	FAIL("-1", "PROCESS_FAIL"),
	/** 请检查报文格式*/
	REQUEST_BODY_IS_MISSING("-1","REQUEST_BODY_IS_MISSING"),
	/** S3处理异常*/
	AMAZON_S3("-1","AMAZON_S3"),
	/** 您被管理员强制下线，请重新登录或联系管理员 */
	SESSION_FORGE("-8", "SESSSION_PURGE"),
	/** Token失效，您的账户可能在异地登录，请检查账户安全或重新登录 */
	SESSION_LOGIN_DUPLICATE("-7", "SESSION_INVALID_TOKEN"),
	/** 无权限访问 */
	ACCESS_WITHOUT_PERMISSION("-11", "PERMISSION_NOACCESS"),
	/** 获取上报单位流程配置信息失败 */
	NOT_FLOW_CONFIG("-12","NOT_FLOW_CONFIG"),
	/** 获取上报单位流程信息失败 */
	GET_FLOW_INFO_FAIL("-13","GET_FLOW_INFO_FAIL"),
	/** 没有文书信息失败 */
	GET_WENSHU_FAIL("-14","GET_WENSHU_FAIL");
	
	
	ResultEnum(String statusCode, String resourceKey) {
		this.statusCode = statusCode;
		this.key = resourceKey;
	}

	private String statusCode;

	private String key;

	public String getStatusCode() {
		return statusCode;
	}

	public static String getMessagebyKey(String key) {
		return ResourcesUtil.getMessage(key);
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

}
